﻿/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __OBJECTS_ID_CARD_H__
#define __OBJECTS_ID_CARD_H__

#include "../tools/head.h"

/////////////////////////////////////////////////////////////////////////////////////////////////////
// 

namespace xos_common
{

    class id_card
    {
    public:
        id_card();
        ~id_card();

	protected:
		int verifyIDCard( const char* input );
		int is_leapyear( int year );
		int getyear( const char* input );
		int getmonth( const char* input );
		int getday( const char* input );
		int check_1to17( const char* input );
		int check18( const char* input );
		int chech_year_month_day( int year, int month, int day );

    public:
		bool is_valid_id_card( const char * lpszIdCard );

    };
} // xos_common

#endif // __OBJECTS_ID_CARD_H__
